import { IContext, ICtrlActionResult, IGridModel, IParam } from '@/core';
import { IMDCtrlAbility } from './i-md-ctrl-ability';

/**
 * 表格部件能力
 *
 * @export
 * @interface IGridAbility
 * @extends {IDECtrlAbility}
 */
export interface IGridAbility extends IMDCtrlAbility<IGridModel> {
	/**
	 * @description 数据导入
	 * @param {IContext} context 上下文
	 * @param {IParam} viewParams 视图参数
	 * @param {IParam[]} data 数据
	 * @memberof IGridAbility
	 */
	importExcel(context: IContext, viewParams: IParam, data: IParam[]): void;

	/**
	 * 新建行
	 *
	 * @return {*}  {Promise<ICtrlActionResult>}
	 * @memberof IGridAbility
	 */
	newRow(data?: IParam[]): Promise<ICtrlActionResult>;

	/**
	 * 切换行编辑状态
	 *
	 * @memberof IGridAbility
	 */
	toggleRowEdit(): void;
}
